//
//  LocalizedKey.swift
//  Waterfall
//
//  Created by jh on 2023/6/8.
//

import SwiftUI
//import Localize_Swift
//
//extension LocalizedStringKey {
//    var stringKey: String {
//        let description = "\(self)"
//        let components = description.components(separatedBy: "key: \"")
//            .map { $0.components(separatedBy: "\",") }
//        return components[1][0]
//    }
//    
//    func stringValue(locale: Locale = .current) -> String {
//        return .localizedString(for: self.stringKey, locale: locale)
//    }
//}
//
//extension String {
//    static func localizedString(for key: String, locale: Locale = .current) -> String {
//        let language = locale.languageCode
//        let value = (language?.contains("en") ?? false) ? "en" : "zh-Hans"
//        let path = Bundle.main.path(forResource: value, ofType: "lproj")!
//        let bundle = Bundle(path: path)!
//        let localizedString = NSLocalizedString(key, bundle: bundle, comment: "")
//        return localizedString
//    }
//    
//    var str: String {
//        return self.localized()
////        return LocalizedStringKey(self).stringValue()
//    }
//}
